package com.zigong.app.ui.adapter.holder;

import android.content.Context;
import android.view.View;
import android.widget.LinearLayout;

import com.ruihang.generalibrary.ui.widget.CustomFontTextView;
import com.zigong.app.R;
import com.zigong.app.beans.Titles;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by Administrator on 2017/7/12 0012.
 */

public class AnchorTitleTiHolder extends BaseAnchorHolder<Titles> implements View.OnClickListener {
    @BindView(R.id.item_anchor_title_name)
    protected CustomFontTextView name;
    @BindView(R.id.item_anchor_title_ll)
    protected LinearLayout anchor_ll;
    @BindView(R.id.item_anchor_title_divider)
    protected View divider;

    public AnchorTitleTiHolder(Context context, View itemView) {
        super(context, itemView);
        itemView.setOnClickListener(this);
    }

    @Override
    protected void initInject() {
        ButterKnife.bind(this, itemView);
    }

    @Override
    public void setData(Titles data) {
        name.setText(data.getTitle());
        anchor_ll.setVisibility(View.VISIBLE);
        divider.setVisibility(View.VISIBLE);
    }

    @Override
    public void onClick(View v) {
        if (internalClick != null) {
            internalClick.onItemInternalClick(itemView, v, getAdapterPosition());
        }
    }
}
